package com.li.dfw_protobuf_to_netty.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.li.dfw_protobuf_to_netty.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    //这个id怎么自增
//    @Select("select * from user where id = #{id} ")
//    public User getUserById(Integer id);

    @Select("select * from account where username = #{username}")
    User getUserByName(String username);

    @Insert("insert into account (username,password,nickname) VALUES (#{username},#{password},#{nickname})")
    void register(String username, String password, String nickname);

    void login(String username, String password);
}
